//**************************************************************//
//**************************************************************//
//*                                                            *//
//*  Copyright (C) 1999 Virtue 3D, Inc.  All Rights Reserved.  *//
//*                                                            *//
//*  File:	   vrIndexedFaceSet.h                              *//
//*  Content:  IndexedFaceSet header file                      *//
//*  Date:     July 26, 1999                                   *//
//*                                                            *//
//**************************************************************//
//**************************************************************//

#ifndef _VRINDEXEDFACESET_H_
#define _VRINDEXEDFACESET_H_

#include "vrNode.h"

class VRIndexedFaceSet: public VRGeometry
{
public:
	VRIndexedFaceSet(void);
	~VRIndexedFaceSet(){};

	virtual void release(void);
	VRDWORD weld(VRSFFloat tolerance);
	VRResult triangulate();
	bool getBoundingBox(VRSFVec3f bottom, VRSFVec3f top);
	void applyTextureTransform(VRTextureTransform*);
	void calculateTexCoord();
	void copy(VRIndexedFaceSet* src);

	VRCoordinate*			coord;
    VRMFInt32				coordIndex;
	VRTextureCoordinate*	texCoord;
	VRMFInt32				texCoordIndex;
	VRColor*				color;
	VRMFInt32				colorIndex;
    VRSFBool				colorPerVertex;
	VRNormal*				normal;
	VRMFInt32				normalIndex;
    VRSFBool				normalPerVertex;
	VRSFBool				ccw;
	VRSFBool				solid;
	VRSFBool				convex;
	VRSFFloat				creaseAngle;
private:
	bool identicalProperties(VRDWORD ind1, VRDWORD ind2, 
					   bool ensureVerColor = true, bool ensurePolColor = true,
					   bool ensureTexCoord = true, bool ensureNormal = true) ;
};

#endif
